package com.example.demo.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 字典表
 *
 * @author tangrh
 */
@Table
@Entity(name = "CODETBL")
@ApiModel("字典值")
public class Code implements Serializable {
    private static final long serialVersionUID = 7116711672369573092L;
    @Id
    @SequenceGenerator(name = "CODE_SEQ", sequenceName = "S_CODE", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "CODE_SEQ")
    @Column(name = "codeid")
    private Long id;

    @ApiModelProperty("表名")
    @Column(name = "tablename")
    @NotBlank
    private String tableName;

    @ApiModelProperty("字典值")
    @Column(name = "value")
    @NotBlank
    private String value;

    @ApiModelProperty("字典值名称")
    @Column(name = "descname")
    private String descName;

    @ApiModelProperty("字段名")
    @Column(name = "colname")
    @NotBlank
    private String colName;

    @ApiModelProperty("描述")
    @Column(name = "remark")
    private String remark;

    @ApiModelProperty("状态：T:禁用，E：启用，D：删除")
    @Column(name = "status")
    @JsonIgnore
    private String status;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDescName() {
        return descName;
    }

    public void setDescName(String descName) {
        this.descName = descName;
    }

    public String getColName() {
        return colName;
    }

    public void setColName(String colName) {
        this.colName = colName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Code{" +
            "id=" + id +
            ", tableName='" + tableName + '\'' +
            ", value='" + value + '\'' +
            ", descName='" + descName + '\'' +
            ", colName='" + colName + '\'' +
            ", remark='" + remark + '\'' +
            ", status='" + status + '\'' +
            '}';
    }
}
